<?php

class TestController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
    }

    public function testboxunitAction()
    {
        // action body
    	$request = $this->getRequest();
    	$form    = new Application_Form_Testboxunit();
    	//if ($this->getRequest()->isPost()) {
    		//if ($form->isValid($request->getPost())) {
    			
    			$size_id = $this->_request->getPost('size_id');
    			$area_id = $this->_request->getPost('area_id');
    			$unit = new Application_Model_BoxUnit();
    	
    			//test 
    			$mapper = new Application_Model_BoxUnitMapper();
    			$unit = $mapper->findAvaliableByAreaId(1,1);
    			
    			
    			$this->view->unit = $unit;
    			/* if(!empty($size_id) && !empty($area_id)){
    				$mapper = new Application_Model_BoxUnitMapper();
    				$unit = $mapper->findAvaliableByArea($size_id, $area_id);
    				$this->view->unit = $unit;
    	
    			} */
    		//}
    	//}
    	
    	$this->view->form = $form;
    }


}





